package com.njupt.twoStage.BinarySearch;

public class RemoveDuplicates {

    public int removeDuplicates(int[] nums) {
        int len = nums.length;
        int num=0;
        for (int i = 0; i <len-2 ; i++) {
            num = nums[i];
            for (int j = i+1; j <len-1 ; j++) {
                if(nums[i] == nums[j]){
                    //删除nums【j】
                    for (int k = j; k <len-1 ; k++) {
                        nums[k] = nums[k+1];
                    }
                }
                j--;
                len--;
            }
        }
        return 0;
    }



    public static void main(String[] args) {
        int[] nums = {0,0,1,1,1,2,2,3,3,4};
        RemoveDuplicates test = new RemoveDuplicates();
        int len = test.removeDuplicates(nums);
        System.out.println(len);
    }
}
